package com.base;

import java.util.Hashtable;


public class Constant {

	public static final String META_CONTENT_TYPE_UTF8 = "<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">";
	public static final String DOCTYPE_XHTML1_TRANSITIONAL = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
	public static final String DOCTYPE_HTML401_TRANSITIONAL = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">";
	public static final String HTML_XMLNS = "xmlns=\"http://www.w3.org/1999/xhtml\"";
	public static final String ADMIN_LOGIN = "ADMIN_LOGIN";
	public static final String Links = "http://210.211.99.58:6868/Upload";
	// Database
	public static final String DB_POOL_MWAP = "vnt_media";
	
	//
	public static Hashtable<String, String> ADMIN_RIGHT = null;
	public static int ADMIN_RIGHT_READ 		= 0x01;
	public static int ADMIN_RIGHT_WRITE 	= 0x02;
	public static int ADMIN_RIGHT_DELETE 	= 0x04;
	
	static {
		ADMIN_RIGHT = new Hashtable<String, String>();
		ADMIN_RIGHT.put("admin", "Tài khoản");
		ADMIN_RIGHT.put("config", "Cấu hình website");
		ADMIN_RIGHT.put("banner", "Banner");
	}
	
	public static String htmlPageOpen() {
		String s = DOCTYPE_XHTML1_TRANSITIONAL + "<html "+HTML_XMLNS+">";
		s += "<head>"+META_CONTENT_TYPE_UTF8;
		return s;
	}
	
	public static String htmlCloseHeadOpenBody() {
		return "</head><body>";
	}
	
	public static String htmlPageClose() {
		return "</body></html>";
	}
	
	public static String redirect(String url) {
		return "<script>location.href='"+url+"';</script>";
	}
	
	public static void main(String[] args) {
		System.out.println(ADMIN_RIGHT_WRITE | ADMIN_RIGHT_DELETE);
	}
}
